package com.u3k.sdk;

import android.content.Context;
import android.content.pm.ProviderInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;

public class d
{
  private e a;
  
  public void a(Context paramContext, ProviderInfo paramProviderInfo)
  {
    this.a = a(paramContext, paramProviderInfo.authority);
  }
  
  public Cursor a(Uri paramUri, String[] paramArrayOfString1, String paramString1, String[] paramArrayOfString2, String paramString2)
  {
    return null;
  }
  
  public String a(Uri paramUri)
  {
    return null;
  }
  
  public int a(Uri paramUri, String paramString, String[] paramArrayOfString)
  {
    return 0;
  }
  
  public ParcelFileDescriptor a(Uri paramUri, String paramString)
  {
    File localFile = this.a.a(paramUri);
    int i = a(paramString);
    try {
      return ParcelFileDescriptor.open(localFile, i);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      return null;
    }
  }
  
  private static e a(Context paramContext, String paramString)
  {
    e locale = null;
    if (locale == null) {
        locale = b(paramContext, paramString);
    }
    return locale;
  }
  
  private static e b(Context paramContext, String paramString)
  {
    f localf = new f(paramString);
    String str1 = paramContext.getPackageName();
    String str2 = "";
    File localFile = null;
    localFile = a(Environment.getExternalStorageDirectory(), new String[] { str2 });
    if (localFile != null) {
      localf.a(str1, localFile);
    }
    return localf;
  }
  
  private static int a(String paramString)
  {
    int i = -100;
    if ("r".equals(paramString)) {
      i = 268435456;
    } else if (("w".equals(paramString)) || ("wt".equals(paramString))) {
      i = 738197504;
    } else if ("wa".equals(paramString)) {
      i = 704643072;
    } else if ("rw".equals(paramString)) {
      i = 939524096;
    } else if ("rwt".equals(paramString)) {
      i = 1006632960;
    }
    return i;
  }
  
  private static File a(File paramFile, String... paramVarArgs)
  {
    File localFile = paramFile;
    for (String str : paramVarArgs) {
      if (str != null) {
        localFile = new File(localFile, str);
      }
    }
    return localFile;
  }
}


